﻿using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using Ue.Infrastructure.Web.UI;
using Ue.Qcdz.Domain;
using Ue.Qcdz.Domain.FriendLink;

namespace Ue.Qcdz.UI.Controls.FriendLink
{
    public class FriendListShow : SkinnedGridView
    {
        private string skinFileName;

        public int Num { get; set; }
        
        #region Overrides of SkinnedControl

        protected override string GetSkinFileName()
        {
            return skinFileName;
        }

        #endregion

        #region Overrides of SkinnedGridView

        protected override void GridViewDataBind(object sender, EventArgs args)
        {
            IFriendLinksRepository repository =
                       Ue.Infrastructure.RepositoryFramework.RepositoryFactory.GetRepository
                           <IFriendLinksRepository, FriendLinks>();
            IList<FriendLinks> list = repository.FindBy(FriendListEnum.Enable,Num);
            Repeater repeater = sender as Repeater;
            repeater.DataSource = list;
            repeater.DataBind();
        }

        #endregion
    }
}
